﻿{tpl head}
<script charset="utf-8" src="../kedit/kindeditor-min.js"></script>
<script type="text/javascript">
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {width:'90%',height:'300px',uploadJson: 'kdupload.php?yeslitpic=1'});
		//给按钮添加click事件
		K('#faddim').click(function() {
			editor.loadPlugin('image', function() {
				//图片弹窗的基本参数配置
				editor.plugin.imageDialog({
					
					showRemote: false, //网络图片不开启
					imageUrl: K('#img').val(), //如果图片路径框内有内容直接赋值于弹出框的图片地址文本框
					//点击弹窗内”确定“按钮所执行的逻辑
					clickFn: function(url, title, width, height, border, align) {
						K('#img').val(url);//获取图片地址
						editor.hideDialog(); //隐藏弹窗
					}
				});
			});
		});
	});
	$(function(){
		$("#danye").click(function(){
			$("#con").show("slow");
		});
		$("#set").click(function(){
			$(".hidden").show("slow");
		});
	});
</script>

<form action="?c=arctype&a=add_do" name="k_form" method="post">
    <table class="new_table" width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
		<thead>
			<tr class="n_bt"><td colspan="2" align="center">内容管理系统</td></tr>
			<tr>
				<th height="28" colspan="2" class="thbt">【{$title}】</th>
			</tr></thead>
		<tbody>
			<tr>
				<td width="22%" height="30" align="right">栏目名称：</td>
				<td width="78%"><input name="typename" type="text" class="input400" value="{$oj.typename}" /></td>
			</tr>
			<tr>
				<td width="22%" height="30" align="right">短标题：</td>
				<td width="78%"><input name="shortname" type="text" class="input400" value="{$oj.shortname}" /></td>
			</tr>

			<tr>
				<td height="30" align="right">所属分类：</td>
				<td><select name="fid" class="input400 selecth" id="fid">{$option_list}</select></td>
			</tr>





			<tr>
				<td height="30" align="right">栏目排序：</td>
				<td><input name="sortrank" type="text" class="input400" value="{if $form_action=='add_do'}99{else}{$oj.sortrank}{/if}" /></td>
			</tr>
			
			<tr>
				<td height="30" align="right">跳转URL：</td>
				<td><input name="jumpurl" type="text"  class="input400" value="{$oj.url}" /></td>
			</tr>
			<tr>
				<td height="30" align="right">关键词：</td>
				<td><input name="keywords" type="text" class="input400" value="{$oj.keywords}" /></td>
			</tr>
			<tr>
				<td height="30" align="right">摘要：</td>
				<td><textarea  name="description" rows="5" class="input400 textareah">{$oj.description}</textarea></td>
			</tr>
			<tr>
				<td height="30" align="right">属性：</td>
				<td>
					<input name="singlepage" type="checkbox" id="danye" value="1" {if $oj.singlepage==1}checked="checked"  {/if}/>  单页
						   <input name="isshow" type="checkbox" id="isshow" value="1" {if $oj.isshow==1 || $form_action=='add_do'}checked="checked" {/if} /> 显示
				</td>
			</tr>
			<tr id="con" >
				<td height="30" align="right">单页内容：</td>
				<td class="pb5"><textarea name="content" cols="95" rows="20" >{$oj.con}</textarea></td>
			</tr>

			<tr>
				<td align="right">上传缩略图：</td>
				<td>
					<input name="img" type="text" id="img" class="input400" value="{$oj.litpic}" />
					<span id="faddim" class="button">上传图片</span>
					<span id="list_img"></span>
				</td>
			</tr>
			<tr class="hidden">
				<td height="30" align="right">列表页模板：</td>
				<td>
					<select name="listtpl" class="input400 selecth" id="fid">
						{if $form_action=='add_do'}<option value="newlist.html" selected="selected">newlist.html</option>{/if}
						{loop $arr_file $v}            
						<option value="{$v}" {if $v==$oj.listtpl}selected="selected"{/if}>{$v}</option>
						{/loop}
					</select>
				</td>
			</tr>
			<tr class="hidden">
				<td height="30" align="right">内容页模板：</td>
				<td>
					<select name="viewtpl" class="input400 selecth" id="fid">
						{if $form_action=='add_do'}<option value="new.html" selected="selected">new.html</option>{/if}
						{loop $arr_file $v}            
						<option value="{$v}" {if $v==$oj.viewtpl}selected="selected"{/if}>{$v}</option>
						{/loop}
					</select>
				</td>
			</tr>
			<tr class="hidden">
				<td height="30" align="right">列表页命名规则：</td>
				<td><input name="listrule" type="text" class="input400" value="{if $form_action=='add_do'}{sitepath}list_{tid}_{page}.html{else}{$oj.listrule}{/if}" /></td>
			</tr>
			<tr class="hidden">
				<td height="30" align="right">内容页命名规则：</td>
				<td><input name="viewrule" type="text" class="input400" value="{if $form_action=='add_do'}{sitepath}{Y}/{M}{D}/{aid}.html{else}{$oj.viewrule}{/if}" /></td>
			</tr>
			<tr>
				<td height="40" colspan="2" align="center" >
					<!--<input class="button" name="into" type="button" id="set" value="设置模板" />-->
					&nbsp;&nbsp;&nbsp;&nbsp;
					<input class="button" name="into" type="submit" id="submit" value="{$submit}" />
					<input name="id" type="hidden" value="{$oj.id}" />
					<input type="hidden" name="c" value="arctype" />
					<input type="hidden" name="a" value="{$form_action}" />
				</td>
			</tr>
		</tbody>
    </table>    
</form>